<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>易利视频</title>
    <link rel="shortcut icon" href="favicon.ico">

    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>

        .download-head {
            position: fixed;
            top: 0px;
            width: 100%;
        }

        .btn-download {
            width: 100%;
            height: 60px;
            border: none;
            background: #dcb481;
            color: #fff;
            font-size: 16px;
        }

        .btn-download:hover {
            background: #dcb481;
        }

        .btn-download:active {
            background: #dca430;
        }

        .download-img {

            width: 100%;
            padding-top: 60px;
        }

        .download-tips {
            padding-top: 20px;
            text-align: center;
        }
    </style>
</head>
<body>
<div class="download-head">
    <button class="btn-download">下载安装>></button>
</div>

<div class="download-img">
    <img src="images/slid_3.jpg" width="100%">
    <img src="images/slid_4.jpg" width="100%">
</div>

<div class="download-tips">
    <h3>iOS企业级应用添加信任</h3>
    <p>安装易利视频后进行以下设置，否则无法使用</p>
    <hr>
    <img src="images/1.png" width="100%">
    <br>
    <br>
    <p style="text-align: left;padding-left: 10px"> 1、进入iPhone的【设置】页面，找到并进入【通用】选项</p>
    <br>
    <img src="images/4.png" width="100%">
    <br>
    <br>
    <p style="text-align: left;padding-left: 10px"> 2、在【通用】中找到并进入【设备管理】</p>
    <br>
    <img src="images/2.png" width="100%">
    <br>
    <br>
    <p style="text-align: left;padding-left: 10px"> 3、在【设备管理】中找到相应的应用点击并选择信任</p>
    <br>
    <img src="images/3.png" width="100%">
    <br>
    <img src="images/5.png" width="100%">
    <img src="images/6.png" width="100%">
</div>

<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
<script>

    function getUrlParam(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]);
        return null;
    }

    let serverUrl = "http://47.96.0.161:8081/"

    $(document).ready(function () {

        let channelCode = getUrlParam("channelCode");
        let inviteCode = getUrlParam("inviteCode");

        if (!channelCode) {
            channelCode = "a001";
        }

        let type = null;
        let u = navigator.userAgent;
        if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) {
            type = "android";
        } else if (u.indexOf('iPhone') > -1) {
            type = "iOS";
        } else if (u.indexOf('Windows Phone') > -1) {
            type = "Windows Phone";
        }

        $(".btn-download").click(function () {

            $.get(serverUrl + "api/downloadLog?shareCode=" + inviteCode, function () {
            });

            if (type === 'iOS') {
                //window.location.href = "itms-services://?action=download-manifest&url=https://github.com/tianlan255/YL/tree/master/" + channelCode + "/YLVideo.plist";
                window.location.href = "itms-services://?action=download-manifest&url=https%3A%2F%2Fdownload.fir.im%2Fapps%2F5bc1f9f5959d6958db49432a%2Finstall%3Fdownload_token%3Ddded7dece1f52757ee965b10592e6299%26release_id%3D5bc1fa84959d6958db494332";
            } else {
                window.location.href = "http://120.55.56.28/package/" + channelCode + "/YLVideo.apk";
            }
        });
    });
</script>
</body>
</html>
